package paypal;

public class PaypalService {

	public static String getPayURL(String sender,
			String receiver, String amount, String memo) {

		String responseString = Pay.doExplicit(sender, receiver, amount, memo);

		Codec decoder = new Codec();
		decoder.Decode(responseString);

		// textBoxPay_PayKey.Text = decoder.UrlParams["payKey"];
		// textBoxPay_ACK.Text = decoder.UrlParams["responseEnvelope.ack"];
		// textBoxPay_Status.Text = decoder.UrlParams["paymentExecStatus"];

		// labelPay_CMDLink.Visible = false;
		// textBoxPay_CMDLink.Visible = false;

		// if (isExplicit)
		// {
		if (decoder.getUrlParams().get("responseEnvelope.ack")
				.equals("Success")) {
			// labelPay_CMDLink.Text = "This is explicit payment";
			// labelPay_CMDLink.Visible = true;
			// textBoxPay_CMDLink.Text = Const.PAY_CMD
			// + decoder.UrlParams["payKey"];
			// textBoxPay_CMDLink.Visible = true;
			return Const.PAY_CMD + decoder.getUrlParams().get("payKey");
		}
		// }
		/*
		 * else { if (decoder.UrlParams["responseEnvelope.ack"] == "Success") {
		 * labelPay_CMDLink.Text =
		 * "This is implicit payment, the payment is COMPLETED";
		 * labelPay_CMDLink.Visible = true;
		 * 
		 * textBoxPay_CMDLink.Visible = false; } }
		 */
		return "";
	}
}
